# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details
#
# Based on the AUR postman-bin package
# Original-Maintainer: Jay Ta'ala <jay@jaytaala.com>
# Original-Contributor: Claudio d'Angelis <claudiodangelis at gmail dot com>

pkgname=postman
_pkgname=Postman
pkgver=10.20
pkgrel=1
pkgdesc='Build, test, and document your APIs faster.'
arch=('x86_64')
url='https://www.postman.com/downloads/'
provides=('postman')
conflicts=('postman')
options=(!strip)
license=('custom')
source=("https://dl.pstmn.io/download/latest/linux_64"
        "$pkgname.desktop")
depends=('libxss' 'nss' 'gtk3')
sha512sums=('576921abd8a8d386c99ae8edcc0f4bd9c912276e0329f04c052308e4db745221e451d01a2188e83cff0fb5af0d03e90696b4dc02398419c9e9fafb5bd8864ff2'
            '17e04efeff5c594ef31de285db9c5c3dd87933e9616f3c879b19405fc8304b37a4ae11e153171feb3cb81158f080c00818d86dc352e2007abe25c45073f102b3')

package() {
  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/opt/$pkgname"

  cp -r "$_pkgname/app" "$pkgdir/opt/$pkgname"
  ln -s "/opt/$pkgname/app/$_pkgname" "$pkgdir/usr/bin/$pkgname"

  install -Dm 644 "$pkgname.desktop" \
    "$pkgdir/usr/share/applications/$pkgname.desktop"
  install -dm 755 "$pkgdir/usr/share/icons/hicolor/128x128/apps"

  ln -s "/opt/$pkgname/app/resources/app/assets/icon.png" \
    "$pkgdir/usr/share/icons/hicolor/128x128/apps/$pkgname.png"
}

